1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing graphics data. Still more particularly, the present invention provides a method and apparatus for handling immediate mode data streams.
2. Description of Related Art
Data processing systems, such as personal computers and work stations, are commonly utilized to run computer-aided design (CAD) applications, computer-aided manufacturing (CAM) applications, and computer-aided software engineering (CASE) tools. Engineers, scientists, technicians, and others employ these applications daily. These applications involve complex calculations, such as finite element analysis, to model stress in structures. Other applications include chemical or molecular modeling applications. CAD/CAM/CASE applications are normally graphics intensive in terms of the information relayed to the user. Data processing system users may employ other graphics intensive applications, such as desktop publishing applications. Generally, users of these applications require and demand that the data processing systems be able to provide extremely fast graphics information.
The processing of a graphics data stream to provide a graphical display on a video display terminal requires an extremely fast graphics system to provide a display with a rapid response. In these types of graphics systems, primitives are received for processing and display. A primitive is a graphics element that is used as a building block for creating images, such as, for example, a point, a line, an arc, a cone, or a sphere. A primitive is defined by a group of one or more vertices. An attribute is used to define how a primitive will be displayed. Attributes include, for example, line style, color, and surface texture. A vertex defines a point, an end point of an edge, or a corner of a polygon where two edges meet. Data also is associated with a vertex in which the data includes information, such as positional coordinates, colors, normals, and texture coordinates. Commands are sent to the graphics system;to define how the primitives and other data should be processed for display.
With the large amounts of data and computations involved in processing graphics data, especially with three-dimensional applications, many of these computations have been offloaded from the central processing units to a graphics adapter. Within these graphics systems, a graphics pipeline located in the graphics adapter is used to process this graphics data. With a pipeline, the graphics data processing is partitioned into stages of processing elements in which processing data may be executed sequentially by separate processing elements.
Currently, an application executing on the host processor generates vertices and sends those vertices to the pipeline in the geometry engine for processing. This data, received by the geometry engine, is called a vertex array data stream. With the host processor handling immediate mode data streams, the data is often buffered or stored during processing, prior to sending the data containing the vertices to the geometry engine. It is desirable, however, to have the geometry engine perform additional functions, such as handling immediate mode data streams in rendering an object to reduce the load on the host processor and reduces the bus bandwidth required. Adding capability to handle immediate mode data streams, however, requires additional circuitry or stages in the pipeline of the geometry engine. This added capability increases the size and complexity of the geometry engine.
Therefore, it would be advantageous to have an improved method and apparatus for handling both vertex array data streams and immediate mode data streams.
The present invention provides a method and apparatus in a geometry engine having a plurality of stages for processing graphics data. An immediate mode data stream is received at a first stage within the plurality of stages. Data from the immediate mode data stream is stored in a storage to build a vertex data structure for processing within the plurality of stages. The vertex data structure is transmitted to the first stage for processing in response to receiving a signal to transmit the vertex data structure. Data for the vertex data structure remains in the storage as default data for a subsequent vertex data structure.
A subsequent stage within the plurality of stages performs vertex stream assembly for both vertex array data streams and intermediate mode data streams. These two stages allow for handling of intermediate mode data streams without adding large amounts of specialized logic to handle immediate mode data streams.